package com.heima.test6;

import java.util.concurrent.ArrayBlockingQueue;

public class Demo02 {
    public static void main(String[] args) throws InterruptedException {
        //创建有界队列 初始容量5
        ArrayBlockingQueue q = new ArrayBlockingQueue(5);
        q.put("aaa");
        q.put("bbb");
        q.put("ccc");
        System.out.println(q.take());
        System.out.println(q.take());
        System.out.println(q.take());
        System.out.println("1111");
        System.out.println(q.take());
        System.out.println("222");


    }
}
